import { App } from 'vue'
import Button from './components/Button/Button.vue'

const plugins = {
    install: (app: App) => {
        // 注册全局属性和方法
        app.config.globalProperties.$echo = (name: string) => {
            return `hello ${name}`
        }
        // 注册全局组件
        app.component('v-button', Button)
        // 全局的依赖注入
        app.provide('test', { message: 'from plugin' })
    }
}

export default plugins